package file.tools;

import java.io.File;
import java.io.FilenameFilter;

public class FileSearch {
	
	private File[] files;
	
	public FileSearch(String directory) {
		File dir = new File(directory);

		String[] children = dir.list();
		if (children == null) {
		
		} else {
		    for (int i=0; i<children.length; i++) {
		        String filename = children[i];
		    }
		}

		FilenameFilter filter = new FilenameFilter() {
		    public boolean accept(File dir, String name) {
		        return name.endsWith(".avi");
		    }
		};
		children = dir.list(filter);

		files = dir.listFiles();
		
	}
	
	public File[] getFiles() {
		return files;
	}
	
	public void setFiles(File[] files) {
		this.files = files;
	}

}
